-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unlock the private 'kebabCase' function at a file level #60755
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -45 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
Flaky tests detected in ee2f801. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8693754569
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Importing private APIs at the file level was not possible because it would cause unit test errors in React Native App. To my knowledge, I don't know why this happens 😅
From my understanding, there should be no good reason for this to happen. I actually have a clue what the problem might be. Taking a look and will reply shortly. |
Okay, found the culprit. It appears that we have circular dependencies in the native app. Currently, the However, you can see that we import modules from gutenberg/packages/components/src/mobile/global-styles-context/utils.native.js Lines 11 to 15 in 30b5e03
That's wrong, of course, since the former isn't a dependency of the latter. To verify my hypothesis, I ran Resolving this will need some reshuffling of native components here and there, so there are no circular dependencies. A similar fix was done by @ellatrix in #57045. I'm quite occupied with other things this week, and won't be able to take a look, so feel free to work on this one @Mamaduka @t-hamano. Thanks 🙌 |
FWIW resolving this will allow us to do single-module unlocks for all other instances we're doing it on runtime for mobile - there are a few more, for example:
|
Thank you, @tyxla! I had the feeling that there was something wrong with the config, but circular dependencies didn't cross my mind. Happy to pick it up from here 🙇 |
Yes I started looking at fixing the circular dependency but didn't finish it, I also have a PR open for this at #57042 |
Thank you, @geriux! I started looking into it, but I've very little experience with RN. I wasn't even able to build the app locally :( |
No worries! I worked on some of those files so that helped a bit! Let us know if the future if we can help with getting the app to build locally 😃 |
Hey everyone 👋 the mobile team just merged #61102 which should solve the blockers in this PR. Please let us know if there are still blockers that we might have missed. Thank you! |
@tyxla, I'll rebase and make sure everything is up to date later today. |
ee2f801
to
aa19eca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just one thing, can this function also be unlocked at the file level?
gutenberg/packages/edit-site/src/components/global-styles/font-library-modal/utils/index.js
Line 187 in 28847b0
const { kebabCase } = unlock( componentsPrivateApis ); |
aa19eca
to
30c38cd
Compare
) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: dcalhoun <dpcalhoun@git.wordpress.org> Co-authored-by: geriux <geriux@git.wordpress.org>
What?
This is a follow-up to #56758.
PR moves the private
kebabCase
function unlocking at the file level.Why?
Private APIs like functions can be unlocked at the file level, avoiding executing unlocking logic multiple times.
Testing Instructions
CI checks should be green.